package com.saftalk.ui;

import com.saftalk.db.entity.photo.FamilyPhoto;

public class UIPhotoResult extends UIResult {


	private static String DEFAULT_DESCRIPTION = "?";
	
	private String photoId;
	private String description;

	public UIPhotoResult(FamilyPhoto photo) {
		if (photo == null) {
			this.success = false;
			this.photoId = null;
			this.description = null;
		} else {
			this.success = true;
			this.photoId =  photo.getPhotoId();
			this.description = ( photo.getDescription() == null ||  photo.getDescription().length() == 0) ? DEFAULT_DESCRIPTION :  photo.getDescription();
		}
	}
	
	public String getPhotoId() {
		return photoId;
	}
	
	public String getDescription() {
		return description;
	}
}
